<?php
		session_start();
		/*$_flean=(basename($_SERVER['SCRIPT_NAME'],'.php'));*/

		if (empty($_GET['out']) && empty($_SESSION['admin']) && !empty($_COOKIE['auto_login']) && !empty($_COOKIE['username']) && empty($_COOKIE['passsword'])) {

			$_SESSION['admin']['username']=$_COOKIE['uaername'];

			if ($a=='login') {

				header('location:index.php');
			}else{

				header('location:index.php?c=index&a=index&admin=1');
			
			}
			
		};



 
		
 
		 
		if (!empty($_SESSION['admin']) && $a=='login' && !empty($_COOKIE['auto']) && empty($_GET['out'])) {
 
			header('location:index.php');
			die;
		}

 
 		$arr = array('login','indexout','code');
 		 
		 if (empty($_SESSION['admin'])   &&  !in_array($a, $arr) ) {
	 		echo '<script>alert("请重新登录");location.href="index.php";</script>';die;
	    
	    }


	    $_flean= VIEW_PATH.'admin/'.$c.'/'.$a;
	
		include (LID_PATH.'my_db.php');
       	$link=db_connect('p301');
/*       	if (!empty($_SESSION['admin'])) {
       			
       		// print_r($_SESSION);die;
       		$rule=$c.'/'.$a;
       		$power_id=getselectByone('power',"rule='$rule'")['id'];
       		$no_check=array('index','login','indexout','code');
       		if (!in_array($power_id,$_SESSION['admin']) && !in_array($a,$no_check)) {
 */      			/*echo '<script>alert("没有权限");history.go(-1);</script>';die;*/
 //    }
 //   		}
       	

		include LID_PATH.'pages.php';
		include LID_PATH.'url.php';
		include LID_PATH.'cate_fun.php';
		include LID_PATH.'thumb.php';
		 
		

	
		
		
	
		
	
	

?>